/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package webServices;

import businessLogic.DataMgr;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import persistence.*;

/**
 *
 * @author thomashuttegger
 */
@WebService(serviceName = "AdminService")
@LocalBean
@Stateless()
@XmlSeeAlso({SimpleBook.class, MusikCd.class, SpecialBook.class, XxxMovie.class})
public class AdminService {
    
    @EJB
    private DataMgr dm;
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Web Service Operation")

 
    @Oneway
    public void addClient(String firstName, String lastName, String adress, String email, String phone) {             
             dm.addClient(firstName, lastName, adress, email, phone);
    }
    
    public void addBook(String title, String isb, String author) {
        dm.addBook(title, isb, author);
    }
        
    public void addCD(String title, String interpret, String record) {
        dm.addCD(title, interpret, record);
    }

    
    public List<Medium> listMedia() {
        List<Medium> media = dm.getAllMedia();
        return media;
    }
    
    public List<Client> listClients() { 
         List<Client> clients = dm.getAllClients();
         return clients;
     }
}
